package com.breeze.mvxdemo.mvp;

import com.breeze.mvxdemo.bean.Account;
import com.breeze.mvxdemo.callbacks.AccountCallback;

import java.util.Random;

public class MVPModel implements MVPContract.IMVPModel {
    @Override
    public void getAccountData(String accountName, AccountCallback callback) {
        Random random = new Random();
        boolean isSuccess = random.nextBoolean();
        if (isSuccess) {
            Account account = new Account(accountName, 100);
            callback.onSuccess(account);
        } else {
            callback.onFailed();
        }
    }
}
